//当前这个js文件(模块)：对所有的API接口进行统一的管理

//引入二次封装的ajax
import requests from './ajax';

//获取首页数据的接口 地址：/getDB 请求方式：get
export const reqHomeDB = () => requests({ url: '/api/getDB', method: 'get' });
//获取专题
//export const reqTopicDB = () => requests({ url: '/api/getDB', method: 'get' });
//获取购物车数据的接口
export const carList = () => requests({url:'/api/getCartList',method:'get'});
//获取品牌数据接口
export const getBrand = (params) => requests.get('/api/getBrand', { params });
//获取商品列表数据接口
export const getGoodsList = (params) => requests.get('/api/getGoodsList', { params });
//获取商品详情数据接口
export const getGoods = (params) => requests.get('/api/getGoods', { params });
//获取商品数量数据接口
export const getCartCount = () =>requests.get('/api/getCartCount');
//修改购物车商品接口
export const updateCartList = (params) => requests.get('/api/updateCartList', { params });
//删除购物车商品接口
export const deleteCartList = (params) => requests.get('/api/deleteCartList', { params });
//xxx接口
export const togCarList = (params) => requests.get('/api/togCarList', { params });
//增加购物车商品接口
/* export const addCar = (id, img, goodsName, price, num) => {
    return requests({
        url: "/api/getCartCount",
        method: "get",
        params: {
            id: id,
            img: img,
            goodsName: goodsName,
            price: price,
            num: num,
        },
    });
}; */
//获取搜索模块数据 地址:/api/list 请求方式:post 参数:需要带参数
export const reqGetSearchInfo = (params) => requests({
    url: '/list',
    method: 'post',
    data: params,
});
//加入购物车
export const addCar = (params) => requests.get('/api/addCartList', { params });

// 获取pupup的数据
export const GetPopupData = () => requests.get('/api/search/index')

// 搜索框商品搜索
export const GetSearchData = (params) => requests.get('/api/goods/list', {params})

// 实时搜索功能
export const GetTimeData = (params) => requests.get('/api/search/helper', {params})

// 清除历史记录
export const ClearHistory = () => requests.post('/api/search/clearhistory')









